package javax.mail.search;

import com.getpebble.android.R;
import com.sun.mail.imap.protocol.ListInfo;
import com.sun.mail.smtp.SMTPMessage;
import java.util.Date;

public abstract class DateTerm extends ComparisonTerm {
    protected Date date;

    public Date getDate() {
        return new Date(this.date.getTime());
    }

    public int getComparison() {
        return this.comparison;
    }

    protected boolean match(Date d) {
        switch (this.comparison) {
            case SMTPMessage.RETURN_FULL /*1*/:
                if (d.before(this.date) || d.equals(this.date)) {
                    return true;
                }
                return false;
            case SMTPMessage.RETURN_HDRS /*2*/:
                return d.before(this.date);
            case ListInfo.INDETERMINATE /*3*/:
                return d.equals(this.date);
            case SMTPMessage.NOTIFY_DELAY /*4*/:
                if (d.equals(this.date)) {
                    return false;
                }
                return true;
            case R.styleable.WalletFragmentStyle_maskedWalletDetailsHeaderTextAppearance /*5*/:
                return d.after(this.date);
            case R.styleable.WalletFragmentStyle_maskedWalletDetailsBackground /*6*/:
                return d.after(this.date) || d.equals(this.date);
            default:
                return false;
        }
    }

    public boolean equals(Object obj) {
        if ((obj instanceof DateTerm) && ((DateTerm) obj).date.equals(this.date) && super.equals(obj)) {
            return true;
        }
        return false;
    }

    public int hashCode() {
        return this.date.hashCode() + super.hashCode();
    }
}
